package com.jrzh.boot.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import com.jrzh.intercepter.sys.SysInterceptor;

@Configuration
public class InterceptorConfig extends WebMvcConfigurerAdapter  {
	
	@Bean
	public SysInterceptor sysInterceptor(){
		return new SysInterceptor();
	}
	
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(sysInterceptor()).addPathPatterns("/**/admin/**");
	}

}
